﻿using System;
using UnityEngine;
using UnityEngine.EventSystems;
using UnityEngine.UI;

namespace Studio
{
	// Token: 0x02000563 RID: 1379
	public class InputFieldToCamera : MonoBehaviour, ISelectHandler, IDeselectHandler, ISubmitHandler, IEventSystemHandler
	{
		// Token: 0x17000445 RID: 1093
		// (get) Token: 0x0600232E RID: 9006 RVA: 0x000D47AC File Offset: 0x000D29AC
		private Canvas canvas
		{
			get
			{
				if (this.m_Canvas == null)
				{
					this.m_Canvas = base.GetComponentInParent<Canvas>();
				}
				return this.m_Canvas;
			}
		}

		// Token: 0x0600232F RID: 9007 RVA: 0x000D47D4 File Offset: 0x000D29D4
		public void OnDeselect(BaseEventData eventData)
		{
			Singleton<Studio>.Instance.isInputNow = false;
		}

		// Token: 0x06002330 RID: 9008 RVA: 0x000D47E4 File Offset: 0x000D29E4
		public void OnSelect(BaseEventData eventData)
		{
			Singleton<Studio>.Instance.isInputNow = true;
			SortCanvas.select = this.canvas;
		}

		// Token: 0x06002331 RID: 9009 RVA: 0x000D47FC File Offset: 0x000D29FC
		public void OnEndEdit()
		{
			Singleton<Studio>.Instance.isInputNow = false;
			EventSystem.current.SetSelectedGameObject(null);
		}

		// Token: 0x06002332 RID: 9010 RVA: 0x000D4814 File Offset: 0x000D2A14
		public void OnSubmit(BaseEventData eventData)
		{
			Singleton<Studio>.Instance.isInputNow = true;
		}

		// Token: 0x06002333 RID: 9011 RVA: 0x000D4824 File Offset: 0x000D2A24
		private void Start()
		{
			this.inputField.onEndEdit.AddListener(delegate(string s)
			{
				this.OnEndEdit();
			});
		}

		// Token: 0x04002426 RID: 9254
		[SerializeField]
		private InputField inputField;

		// Token: 0x04002427 RID: 9255
		[SerializeField]
		private Canvas m_Canvas;
	}
}
